package com.ruoyi.web.controller.common;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.ImAppInfoVo;
import com.ruoyi.system.im.TencentCloudImUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/qq")
public class testaController {


    @Autowired
    private TencentCloudImUtil tencentCloudImUtil;

    @PostMapping("/aa")
    public AjaxResult aa(){
//        tencentCloudImUtil.accountImport("1","测试用户名","http://119.3.58.86:8151/profile/upload/2024/03/05/KoDALzhnE10yfa0d3ff5c0d70339a3d0281acc1940ea_20240305111340A001.png");
//        List<String> list=new ArrayList<>();
//        list.add("1");
//        tencentCloudImUtil.accountCheck(list);
//        Integer xiaowu = tencentCloudImUtil.getUserGroupNum("xiaowu");

//        tencentCloudImUtil.adminGetRoamMsg("xiaowu","xiaoliu",100,1584669600L,1721943947L,"");
//        tencentCloudImUtil.sendMsg(1,"test-user1","demo","TIMTextElem","发送个消息");
//        List<String> userFriendList = tencentCloudImUtil.getUserFriendList("test-user1");
//        System.out.println(userFriendList);
                List<String> list=new ArrayList<>();
//        list.add("xiaoliu");
//        tencentCloudImUtil.update("@TGS#2TXUKAF5CN","修改后的群名","这是一个测试群");
//        tencentCloudImUtil.deleteGroupContract("@TGS#2TXUKAF5CN");
//        list.add("xiaoliu");
//        tencentCloudImUtil.deleteUserContact("xiaowu",list);
        List<ImAppInfoVo> appInfo = tencentCloudImUtil.getAppInfo();
        System.out.println(appInfo);
        return AjaxResult.success();
    }

    public static void main(String[] args) throws InterruptedException {
        System.out.println(new Date().getTime());
        Thread.sleep(2000);
        System.out.println(new Date().getTime());
    }
}
